<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Remove Invoice</title>
        <link rel="stylesheet" href="<c:url value="/default.css"/>" type="text/css">
    </head>
    <body>
        <div>
        <h1>Naozaj chcete odstrániť faktúru?</h1>
        <form action="<c:url value="/ConfirmRemoveInvoice?id=${invoice.id}"/>"  method="post">
            <table style="margin:0px auto">
                <tr class="odd">
                    <th>Číslo faktury*:</th>
                    <td>${invoice.invoiceNumber}</td>
                </tr>
                <tr class="even">
                    <th>Typ platby*:</th>
                    <td>${invoice.paymentType}</td>
                </tr>
                <tr class="odd">
                    <th>Dátum vystavenia*:</th>
                    <td>${niceInvoicingDate}</td>
                </tr>
                <tr class="even">
                    <th>Dátum splatnosti*:</th>
                    <td>${niceDueDate}</td>
                </tr>
                <tr class="odd">
                    <th>Účet:</th>
                    <td>${invoice.bankAccount}</td>
                </tr>
                <tr class="even">
                    <th>Faktúru vystavil*:</th>
                    <td>${invoice.drawer}</td>
                </tr>
                <tr class="odd">
                    <th>Variabilný symbol:</th>
                    <td>${invoice.variableSymbol}</td>
                </tr>
            </table>
            Dodávateľ:
            <table style="margin:0px auto">
                <tr class="even">
                    <th>Meno*:</th>
                    <td>${invoice.distributor.subjectName}</td>
                </tr>
                <tr class="odd">
                    <th>Mesto*:</th>
                    <td>${invoice.distributor.city}</td>
                </tr>
                <tr class="even">
                    <th>Ulica:</th>
                    <td>${invoice.distributor.street}</td>
                </tr>
                <tr class="odd">
                    <th>Číslo ulice*:</th>
                    <td>${invoice.distributor.number}</td>
                </tr>
                <tr class="even">
                    <th>PSČ*:</th>
                    <td>${invoice.distributor.postalCode}</td>
                </tr>
                <tr class="odd">
                    <th>Telefón:</th>
                    <td>${invoice.distributor.phone}</td>
                </tr>
                <tr class="even">
                    <th>E-mail:</th>
                    <td>${invoice.distributor.mail}</td>
                </tr>
                <tr class="odd">
                    <th>IČO:</th>
                    <td>${invoice.distributor.idNumber}</td>
                </tr>
            </table>
            Odberateľ:
            <table style="margin:0px auto">
                <tr class="even">
                    <th>Meno*:</th>
                    <td>${invoice.consumer.subjectName}</td>
                </tr>
                <tr class="odd">
                    <th>Mesto*:</th>
                    <td>${invoice.consumer.city}</td>
                </tr>
                <tr class="even">
                    <th>Ulica:</th>
                    <td>${invoice.consumer.street}</td>
                </tr>
                <tr class="odd">
                    <th>Číslo ulice*:</th>
                    <td>${invoice.consumer.number}</td>
                </tr>
                <tr class="even">
                    <th>PSČ:</th>
                    <td>${invoice.consumer.postalCode}</td>
                </tr>
                <tr class="odd">
                    <th>Telefón:</th>
                    <td>${invoice.consumer.phone}</td>
                </tr>
                <tr class="even">
                    <th>E-mail:</th>
                    <td>${invoice.consumer.mail}</td>
                </tr>
                <tr class="odd">
                    <th>IČO:</th>
                    <td>${invoice.consumer.idNumber}</td>
                </tr>
            </table>
            Položky:
            <table id="items" style="margin:0px auto">
                <tr id="row1" class="even">
                    <th>Názov*:</th>
                    <td>${invoice.items[0].note}</td>
                    <th>Cena*:</th>
                    <td>${invoice.items[0].priceForUnit}</td>
                    <th>Počet*:</th>
                    <td>${invoice.items[0].count}</td>
                </tr>
                <c:forEach items="${invoice.items}" begin="1" var="item" varStatus="loopStatus">
                    <tr class="${loopStatus.index % 2 == 0 ? 'odd' : 'even'}">

                        <th>Názov*:</th><td>${item.note}</td>
                        <th>Cena*:</th><td>${item.priceForUnit}</td>
                        <th>Počet*:</th><td>${item.count}</td>
                    </tr>
                </c:forEach>
            </table>
            <p>
                <input type="Submit" value="Odstrániť" name="submit" />
                <span class="button"><a href="index.jsp">Zrušiť</a></span>
            </p>
        </form>
        </div>
    </body>
</html>

